# Maintainer: Levente Polyak <anthraxx@archlinux.org>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Sylvain HENRY <hsyl20@yahoo.fr>
# Contributor: Hervé YVIQUEL <elldekaa@gmail.com>

_realname=hwloc
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=2.2.0
pkgrel=1
pkgdesc='Portable Hardware Locality is a portable abstraction of hierarchical architectures'
arch=('any')
depends=("${MINGW_PACKAGE_PREFIX}-libtool")
makedepends=("${MINGW_PACKAGE_PREFIX}-cairo" "${MINGW_PACKAGE_PREFIX}-libxml2")
optdepends=("${MINGW_PACKAGE_PREFIX}-cairo" "${MINGW_PACKAGE_PREFIX}-libxml2")
options=('!docs')
license=('BSD')
url='https://www.open-mpi.org/projects/hwloc/'
source=(https://www.open-mpi.org/software/hwloc/v${pkgver%.*}/downloads/${_realname}-${pkgver}.tar.bz2)
sha512sums=('23efd1d5e2df870ca7a0abb9b3c28c5c5d60dd0cc650ee95d20d5934f48947cbe1d3cf4e90e02b2dc61062ddf7afd67f2c1cf6e1862a48397078d66dd798e850')
b2sums=('00e10f9c7467e6342e14a45d583ed307103428085a9b88398464f0439fec48647949aa80e099042b915b2c371fe105d61e8490d0555383d94740f3e6dab5aeee')

# =========================================== #

prepare() {
  cd hwloc-${pkgver}
  autoreconf -fiv
}

build() {
  cd hwloc-${pkgver}
  ./configure \
    --prefix=${MINGW_PREFIX} \
    --sbindir=${MINGW_PREFIX}/bin \
    --sysconfdir=${MINGW_PREFIX}/etc \
    --enable-static \
    --enable-plugins \
    
  make
}

check() {
  cd hwloc-${pkgver}
  make check-am
}

package() {
  cd hwloc-${pkgver}
  make install DESTDIR="${pkgdir}" 
  install -Dm 644 COPYING -t ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
}

# vim: ts=2 sw=2 et:
